.class Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;
.super Landroid/os/AsyncTask;
.source "SpicyDealsAddActivity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/opongo/android/custom/SpicyDealsAddActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "sendDealAsyncTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Void;",
        "Lorg/json/JSONObject;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;


# direct methods
.method private constructor <init>(Lcom/opongo/android/custom/SpicyDealsAddActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 168
    iput-object p1, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/opongo/android/custom/SpicyDealsAddActivity;Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 168
    invoke-direct {p0, p1}, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;-><init>(Lcom/opongo/android/custom/SpicyDealsAddActivity;)V

    return-void
.end method


# virtual methods
.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->doInBackground([Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    return-object v0
.end method

.method protected varargs doInBackground([Ljava/lang/String;)Lorg/json/JSONObject;
    .locals 18
    .parameter "params"

    .prologue
    .line 172
    sget-boolean v1, Lcom/opongo/android/custom/SpicyDealsAddActivity;->DEBUG:Z

    if-eqz v1, :cond_0

    .line 173
    invoke-static {}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$0()Ljava/lang/String;

    move-result-object v1

    const-string v2, "Downloading comments..."

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 177
    :cond_0
    :try_start_0
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    invoke-virtual {v1}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 178
    const v2, 0x7f0d0004

    .line 177
    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v16

    .line 180
    .local v16, itemsType:[Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    invoke-virtual {v1}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 181
    const v2, 0x7f0d0005

    .line 180
    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v15

    .line 186
    .local v15, itemsCat:[Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->apiManager:Lcom/opongo/blogapp/manager/APIManager;
    invoke-static {v1}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$1(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Lcom/opongo/blogapp/manager/APIManager;

    move-result-object v1

    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_name:Landroid/widget/EditText;
    invoke-static {v2}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$2(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v2

    .line 187
    invoke-virtual {v2}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v2

    invoke-interface {v2}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v2

    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_title:Landroid/widget/EditText;
    invoke-static {v3}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$3(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v3

    invoke-virtual {v3}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v3

    .line 188
    invoke-interface {v3}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v3

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_content:Landroid/widget/EditText;
    invoke-static {v4}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$4(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v4

    invoke-virtual {v4}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v4

    invoke-interface {v4}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v4

    .line 189
    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_price:Landroid/widget/EditText;
    invoke-static {v5}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$5(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v5

    invoke-virtual {v5}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v5

    invoke-interface {v5}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v5

    move-object/from16 v0, p0

    iget-object v6, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_link:Landroid/widget/EditText;
    invoke-static {v6}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$6(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v6

    .line 190
    invoke-virtual {v6}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v6

    invoke-interface {v6}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v6

    move-object/from16 v0, p0

    iget-object v7, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_date:Landroid/widget/EditText;
    invoke-static {v7}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$7(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v7

    .line 191
    invoke-virtual {v7}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v7

    invoke-interface {v7}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v7

    move-object/from16 v0, p0

    iget-object v8, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_code:Landroid/widget/EditText;
    invoke-static {v8}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$8(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v8

    .line 192
    invoke-virtual {v8}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v8

    invoke-interface {v8}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v8

    move-object/from16 v0, p0

    iget-object v9, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_discount:Landroid/widget/EditText;
    invoke-static {v9}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$9(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v9

    .line 193
    invoke-virtual {v9}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v9

    invoke-interface {v9}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v9

    move-object/from16 v0, p0

    iget-object v10, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_place:Landroid/widget/EditText;
    invoke-static {v10}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$10(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/EditText;

    move-result-object v10

    .line 194
    invoke-virtual {v10}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v10

    invoke-interface {v10}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v10

    move-object/from16 v0, p0

    iget-object v11, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_cat:Landroid/widget/Spinner;
    invoke-static {v11}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$11(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/Spinner;

    move-result-object v11

    .line 195
    invoke-virtual {v11}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v11

    aget-object v11, v15, v11

    .line 196
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->spicydeals_type:Landroid/widget/Spinner;
    invoke-static {v12}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$12(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/widget/Spinner;

    move-result-object v12

    invoke-virtual {v12}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v12

    aget-object v12, v16, v12

    .line 197
    move-object/from16 v0, p0

    iget-object v13, v0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->captureBmp:Landroid/graphics/Bitmap;
    invoke-static {v13}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$13(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/graphics/Bitmap;

    move-result-object v13

    .line 186
    invoke-virtual/range {v1 .. v13}, Lcom/opongo/blogapp/manager/APIManager;->addDeal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v17

    .line 204
    .end local v15           #itemsCat:[Ljava/lang/String;
    .end local v16           #itemsType:[Ljava/lang/String;
    :goto_0
    return-object v17

    .line 199
    :catch_0
    move-exception v14

    .line 201
    .local v14, e:Lorg/json/JSONException;
    invoke-virtual {v14}, Lorg/json/JSONException;->printStackTrace()V

    .line 204
    const/16 v17, 0x0

    goto :goto_0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Lorg/json/JSONObject;

    invoke-virtual {p0, p1}, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->onPostExecute(Lorg/json/JSONObject;)V

    return-void
.end method

.method protected onPostExecute(Lorg/json/JSONObject;)V
    .locals 6
    .parameter "result"

    .prologue
    .line 209
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->progressDialog:Landroid/app/ProgressDialog;
    invoke-static {v2}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$14(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/app/ProgressDialog;

    move-result-object v2

    invoke-virtual {v2}, Landroid/app/ProgressDialog;->dismiss()V

    .line 211
    if-eqz p1, :cond_1

    .line 213
    sget-boolean v2, Lcom/opongo/android/custom/SpicyDealsAddActivity;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 214
    invoke-static {}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$0()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 217
    :cond_0
    :try_start_0
    const-string v2, "success"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getBoolean(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 218
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    .line 219
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    const v4, 0x7f070056

    invoke-virtual {v3, v4}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 220
    iget-object v4, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    const v5, 0x7f070055

    invoke-virtual {v4, v5}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 221
    const/4 v5, 0x1

    .line 218
    #calls: Lcom/opongo/android/custom/SpicyDealsAddActivity;->showAlert(Ljava/lang/String;Ljava/lang/String;Z)V
    invoke-static {v2, v3, v4, v5}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$15(Lcom/opongo/android/custom/SpicyDealsAddActivity;Ljava/lang/String;Ljava/lang/String;Z)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 242
    :cond_1
    :goto_0
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    #getter for: Lcom/opongo/android/custom/SpicyDealsAddActivity;->editor:Landroid/content/SharedPreferences$Editor;
    invoke-static {v2}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$16(Lcom/opongo/android/custom/SpicyDealsAddActivity;)Landroid/content/SharedPreferences$Editor;

    move-result-object v2

    invoke-interface {v2}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 243
    return-void

    .line 223
    :cond_2
    :try_start_1
    const-string v2, "errors"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 224
    const-string v2, "errors"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    .line 225
    const-string v3, "description"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 226
    .local v1, message:Ljava/lang/String;
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    .line 227
    iget-object v3, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    const v4, 0x7f070057

    invoke-virtual {v3, v4}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 228
    const/4 v4, 0x0

    .line 226
    #calls: Lcom/opongo/android/custom/SpicyDealsAddActivity;->showAlert(Ljava/lang/String;Ljava/lang/String;Z)V
    invoke-static {v2, v3, v1, v4}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$15(Lcom/opongo/android/custom/SpicyDealsAddActivity;Ljava/lang/String;Ljava/lang/String;Z)V
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 235
    .end local v1           #message:Ljava/lang/String;
    :catch_0
    move-exception v0

    .line 237
    .local v0, e:Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0

    .line 230
    .end local v0           #e:Lorg/json/JSONException;
    :cond_3
    :try_start_2
    iget-object v2, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    .line 231
    const/4 v3, 0x0

    .line 232
    iget-object v4, p0, Lcom/opongo/android/custom/SpicyDealsAddActivity$sendDealAsyncTask;->this$0:Lcom/opongo/android/custom/SpicyDealsAddActivity;

    const v5, 0x7f070057

    invoke-virtual {v4, v5}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 233
    const/4 v5, 0x0

    .line 230
    #calls: Lcom/opongo/android/custom/SpicyDealsAddActivity;->showAlert(Ljava/lang/String;Ljava/lang/String;Z)V
    invoke-static {v2, v3, v4, v5}, Lcom/opongo/android/custom/SpicyDealsAddActivity;->access$15(Lcom/opongo/android/custom/SpicyDealsAddActivity;Ljava/lang/String;Ljava/lang/String;Z)V
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0
.end method
